home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d1 / dpath30.arc / DPATH30.DOC < prev    next >
Text File  |  1991-09-15  |  10KB  |  250 lines

  1.                               DPATH version 3.0
  2.  
  3.                        Written by James A. McGreggor Jr.
  4.  
  5. Both Dpath v 3.0 and this documentation are hereby contributed to the public
  6. domain in the interests of making PC/MS-DOS the complete product that it
  7. should be.  Shame on you, IBM.  Microsoft, I have come to expect very little
  8. from you, and you have rarely disappointed me !
  9.  
  10.  
  11. New Dpath features:
  12.  
  13. Beginning with release 3.0, Dpath includes the optional feature of allowing
  14. (most) programs to write to a file which is located in a subdirectory other
  15. than the current directory.  This is a powerful feature and AN EXTREMELY
  16. DANGEROUS ONE !  Please do not enable this feature until you have read this
  17. entire document.  The default is for this feature to be disabled, and with good
  18. reason.  Please experiment on test files only until you thoroughly understand
  19. how it works.  In fact, if you feel that you will not be using this option, I
  20. suggest that you stick with Dpath version 2.0.  YOU HAVE BEEN WARNED.
  21.  
  22.  
  23. What Dpath Does:
  24.  
  25. Dpath allows DOS to access data files in the same way that DOS currently
  26. locates programs for execution.
  27.  
  28. Dpath will write to files which are not located in the current subdirectory.
  29.  
  30. Dpath does not work with the DELETE or RENAME commands.  Imagine the problems
  31. that it could cause if it did !
  32.  
  33. Dpath does not work with programs that use the DOS FIND FIRST function calls,
  34. which is most programs which allow the use of DOS wild-card characters.  If it
  35. did, you'd never be sure what it was going to do !
  36.  
  37.  
  38. How Dpath Works:
  39.  
  40. When a file is to be accessed, the current directory is searched, as always.
  41. If the file is not found, the directories in the defined path are searched in
  42. the order specified.  If the file is not found, you get the normal "File not
  43. found" message.  Otherwise, the file is opened and things proceed normally.
  44.  
  45.  
  46. Installing Dpath:
  47.  
  48. Dpath is installed as a resident DOS extension.  You can do this with an
  49. AUTOEXEC.BAT file or by issuing the command from the keyboard. To remove it,
  50. you must re-boot.  However, you can turn Dpath on and off with the /O and /NO
  51. parameters.
  52.  
  53.  
  54. Dpath Parameters:
  55.  
  56. ?   This is a call to Dpath help.  All other parameters are
  57.     ignored if ? is used and list of options is displayed.
  58.  
  59. /O  Allows Dpath to help with functions that open files.  This is
  60.     the Dpath default setting.
  61.  
  62. /NO Effectively disables Dpath.  /O and /C work together.  If /NO
  63.     is in effect, then /NC is also in effect.
  64.  
  65. /C  Allows your programs to write to a file located in a directory
  66.     other than the current directory, provided that the file exists.
  67.  
  68. /NC Disables the /C option.
  69.  
  70. /P  Copies the current path into the resident portion of Dpath.
  71.     Allows you to change the current path setting at any time.
  72.  
  73. /NM Turns off all Dpath messages except error messages.
  74.  
  75.  
  76. Default Parameters:
  77.  
  78. The default parameters are /O/NC.  The current path info is not copied
  79. to the resident portion of Dpath unless you use the /P option.
  80.  
  81.  
  82. Specifying a path:
  83.  
  84. The path is defined to Dpath in two ways; via a SET DP=\path;...;\path command
  85. or a PATH \path;...;\path command.  The SET DP command will take precedence, if
  86. present.  This allows you to specify two different paths, one for programs
  87. (PATH command) and one for data files (SET DP= command).
  88.  
  89.  
  90. File names Containing a path specifier:
  91.  
  92. If you enter a file name with a path specifier, Dpath assumes you know what you
  93. want, and does not interfere.
  94.  
  95.  
  96. Hard-coded Drive Specifications:
  97.  
  98. Dpath will generally work as intended if file names contain a drive specifier.
  99. If the file is found on the drive specified, the operation proceeds normally.
  100. If not, the drive letter is stripped off of the file name and the operation is
  101. retried using the specified path.
  102.  
  103.  
  104. Syntax:
  105.  
  106. Dpath syntax is as follows:
  107.  
  108.       Dpath [?][/O or /NO][/C or /NC][/P][/NM]
  109.  
  110. Any other parameters will cause an error message and will be ignored.
  111.  
  112. If ? parameter is used, all other parameters will be ignored.
  113.  
  114. /NO assumes /NC.  /C assumes /O.  The reverse is not true.
  115.  
  116. If parameters conflict (ie. /C/NO), the last parameter in the list,
  117. in this case /NO, will be in effect.  The result would be /NO/NC.
  118.  
  119. If no parameters are used, the current state of Dpath is displayed.
  120.  
  121.  
  122. WARNING REGARDING /C OPTION:
  123.  
  124. If you are not thoroughly familiar with the way the /C option works, disaster
  125. may result.  Here is an example.  Assume the /C option is active and that the
  126. current directory is DIR1.  Also assume that the current data path is \DIR2.
  127.  
  128. Also assume that you boot up your favorite word processor and tell it to edit a
  129. file called KEYDATA.TXT.  Dpath will search DIR1 for the file.  If not found,
  130. it will then search DIR2.  If found in DIR2, this is the file that will be
  131. modified.  If that's what you want, there is no problem.  But suppose you
  132. wanted to create a new file in the current directory.  You will not be able to
  133. do it if a file with the same name exists anywhere in the current data path.
  134.  
  135. Another example:  Assume default drive A: and data path A:\;A:\DIR1;A:\DIR2.
  136. Also assume you want to format a DOS diskette on drive B:.
  137.  
  138. You issue the command FORMAT B:/S.  The diskette in B: is formatted, as usual.
  139. Then DOS attempts to copy IBMBIO.COM and IBMDOS.COM to B:.  The two files are
  140. not found on B:, but they are found on A:.  The result is that they will be
  141. copied to A: and not to B: as you had intended.  The newly formatted diskette
  142. in B: will NOT contain DOS.
  143.  
  144. The general rule is as follows:
  145.  
  146.    When the /C parameter is in effect, DPATH v3.0 will NEVER create
  147.    a new file if a file currently exists anywhere in the data path
  148.    with the same name.
  149.  
  150.    DPATH v3.0 will use the first copy of a file that it encounters,
  151.    if the file does not exist within the current subdirectory.  The
  152.    order in which you specify the subdirectories to DPATH is therefore
  153.    important.
  154.  
  155.    If an application program specifies a subdirectory when accessing
  156.    a file, DPATH assumes the program knows what it wants, and does
  157.    not interfere.  However, you may not always be aware that your
  158.    program is doing this.  If DPATH does not work with a particular
  159.    program, this is the most likely explanation.  However, DPATH is
  160.    not required with programs that are smart enough to look in a
  161.    subdirectory other than the current directory, so this is no real
  162.    loss.  Simply tell your program where your files are located, and
  163.    all will be right with the world.....
  164.  
  165.  
  166. For best results:
  167.  
  168. If the /C option causes problems, why did I include it ?  Because of popular
  169. demand and against my better judgement.  I knew that those who were requesting
  170. this option could handle it, but what about the rest of the Dpath users ?
  171. However, there is a very good reason for having this option:
  172.  
  173. Suppose your word processor has a dictionary that allows you to add new words.
  174. Without the /C option, you could read the dictionary, but would have a tough
  175. time adding new words.  In effect, you would have to keep a copy of your
  176. dictionary in every subdirectory that contained documents that you want to
  177. edit.
  178.  
  179. With the /C option enabled, you require only one copy of your dictionary.  As
  180. long as the data path points to its subdirectory, adding new words is not a
  181. problem.
  182.  
  183. I have found that the best way to use Dpath is as follows:
  184.  
  185.    1.  Place your programs in subdirectories pointed to by your DOS
  186.        PATH.
  187.  
  188.    2.  Place data files, such as overlays, tables, message files, etc.
  189.        in subdirectories pointed to by your "set dp=......." command.
  190.  
  191.    3.  Files to be created or otherwise modified should be in the
  192.        current subdirectory.
  193.  
  194.  
  195. An example using dBase III:
  196.  
  197.    1.  The DOS PATH is c:\;c:\dos;c:\progs
  198.  
  199.    2.  The datapath is c:\overlays;c:\datafiles
  200.  
  201.    3.  The current directory is \databases.
  202.  
  203.    4.  \progs would contain DBASE.EXE.  \overlays would contain
  204.        DBASE.OVR, ASSIST.HLP, and HELP.DBS.  \datafiles would contain
  205.        DBASEMSG.TXT and \databases would contain the DBF,FRM,FMT, and
  206.        MEM files that you create and modify when using DBASE.
  207.  
  208.  
  209. An example using Wordstar:
  210.  
  211.    1.  WS.COM would be located in c:\progs.
  212.  
  213.    2.  WSOVLY1.OVR and WSMSGS.OVR would be in C:\overlays.
  214.  
  215.    3.  Wordstar documents may now be edited in any current directory
  216.        without requiring the presence of the two OVR files in that
  217.        directory.
  218.  
  219. Used in this way, Dpath is useful without being a danger.
  220.  
  221.  
  222. Misfeatures and bugs:
  223.  
  224.    1.  Dpath does not work with dBase II when attempting to open
  225.        DBASEOVR.COM.  I've traced DBASE.COM in an attempt to find
  226.        out why and discovered that the program does some really
  227.        strange things.  I don't know.  Ask Ashton-Tate, but I doubt
  228.        that they know either.  Maybe Wayne Radliff knows.....
  229.  
  230.    2.  When using the /C option with Wordstar 3.3, I've noticed that
  231.        you can open a file in another directory for edit, but when the
  232.        file is saved, it is always saved to the current directory.
  233.        Again, I don't know why this happens.  I haven't tested this
  234.        with prior versions of Wordstar.
  235.  
  236.    3.  Programs that create backup files may cause a problem.  This
  237.        is because they don't really create the backup files.  They
  238.        simply rename the old file with an extension of BAK or some
  239.        such and then save the new file under the old name.  Dpath
  240.        does not work with DOS RENAME...by design.  Therefore, the
  241.        /C option when used with this type of program may lead to
  242.        complaints about unsuccessful backups.....
  243.  
  244.  
  245. Keep on pathin'...............
  246.  
  247.  
  248. James A. McGreggor Jr.
  249. 1/26/85
  250.